<?php
class Loader{

	protected $pathController = array();
	protected $pathModel      = array();
	protected $pathView       = array();


	public function __construct(){

		ini_set('display_errors', true);
		error_reporting(E_ALL);

		echo "Construtor Loader <br>";

		$this->pathController = "Controller/";
		$this->pathModel      = "Model";
		$this->pathView       = "View";

		spl_autoload_register(array('Loader', 'loadController'));

		
		//spl_autoload_register(array($this, 'loadModel'));
		//spl_autoload_register(array($this, 'loadView'));

	}

	public function loadController($controller){		
		if(file_exists($this->pathController . $controller . ".php")){
			require_once($this->pathController . $controller . ".php");
		}
		else{
			echo "Err";
			throw new Exception("Arquivo não encontrado, certifique-se que criou:" .$this->pathController . $controller . ".php");
		}
	}

	public function loadModel($model){

	}

	public function loadView($view){

	}




}

?>